xentrace: Don't append trace on existing file.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 4 Dec 2007 10:17:32 +0000 (10:17 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 4 Dec 2007 10:17:32 +0000 (10:17 +0000)
commit1f74affa2d43cebb224b1ef56a0a6abdbf822e65
treeb0f0cabfa2a6236db6bede5b536c2c6a30578397
parent9f0c829d98a76702c7b69b9dc34aaed2d281ce4e
xentrace: Don't append trace on existing file.

When you run "xentrace -e <mask> trace.output" the first time, all is
fine. When you run it a second time, then the data is appended which
makes you reading old data with xentrace_format and you interprete it
as new data. This usually happens when you automated tracing guests
with xentrace and xentrace_format with a script.

Therefore, attached patch makes xentrace to truncate the file to zero
bytes before writing any data.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
tools/xentrace/xentrace.c